{
    rules+: [
         {
            // 节点内存已满（剩余<10％）
            alert: 'NodeOutOfMemory',
            annotations: {
                message: '内存即将饱满 (< 10% left)  当前值 = {{ $value }}  告警主机: {{ labels.instance }}',
                summary: 'Node out of memory (instance {{ labels.instance }})',
                runbook: $._config.runbook,
            },
            expr: |||
              node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10
            |||,
            'for': '2m',
            labels: {
                severity: 'warning'
            },
        },
        {
            // 节点承受内存压力。重大页面错误率高
            alert: 'NodeMemoryUnderMemoryPressure',
            annotations: {
                message: '内存压力过大。处理进程主要页面故障率高  当前值 = {{ $value }}  告警主机: {{ labels.instance }}.',
                summary: 'Node memory under memory pressure (instance {{ labels.instance }}).',
                runbook: $._config.runbook,
            },
            expr: |||
              rate(node_vmstat_pgmajfault[1m]) > 1000
            |||,
            'for': '2m',
            labels: {
                severity: 'warning'
            },
        },
        {
            // 节点交换分区即将爆满（> 80％）
            alert: 'NodeSwapIsFillingUp',
            annotations: {
                message: '交换分区即将饱满 (>80%)  当前值 = {{ $value }}  告警主机: {{ labels.instance }}',
                summary: 'Host swap is filling up (instance {{ labels.instance }})',
                runbook: $._config.runbook,
            },
            expr: |||
              (1 - (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes)) * 100 > 80
            |||,
            'for': '2m',
            labels: {
                severity: 'warning'
            },
        },
    ],
}
